{% extends "auth_log/login.html" %}
{% load staticfiles %}
{% block content %}

    {% if type == 11 %}
        <div id="login" class="a col-sm-offset-4">密码重置...</div>
        <form class="form-horizontal" role="form" method="post" action="/auth/login/find/psw/?type=2">
        <div class="form-group" style="margin-right:0px">
            <label for="firstname" class="col-sm-4 control-label">账号</label>
            <div class="col-sm-5">
              <input type="text" name="username" class="form-control" required id="firstname" placeholder="请输入账号">
            </div>
        </div>
        <div class="form-group" style="margin-right:0px">
            <label for="firstname" class="col-sm-4 control-label">真实姓名</label>
            <div class="col-sm-5">
              <input type="text" name="name" class="form-control" required id="firstname" placeholder="请输入真实姓名">
            </div>
        </div>
        <div class="form-group" style="margin-right:0px">
            <label for="firstname" class="col-sm-4 control-label">手机号</label>
            <div class="col-sm-5">
              <input type="text" name="phone" class="form-control" maxlength="11" minlength="11" required id="firstname" placeholder="请输入手机号">
            </div>
        </div>
        <div class="form-group" style="margin-right:0px">
            <label for="firstname" class="col-sm-4 control-label">身份证号</label>
            <div class="col-sm-5">
              <input type="text" name="idcard" class="form-control" required maxlength="18" minlength="18" id="firstname" placeholder="请输入身份证号">
            </div>
        </div>
        <div class="form-group" style="margin-right:0px">
            <div class="col-sm-offset-4 col-sm-6">
              <button type="submit" class="btn btn-default">提交</button>
            </div>
        </div>
        {% if error %}
        <div class="col-sm-offset-4 col-sm-8 error">{{ error }} </div>
        {% endif %}
        <div class="col-sm-offset-4 col-sm-8 tip">我突然想起了密码&#x3000;<a href="/">登录</a></div>
        <div class="col-sm-offset-4 col-sm-8 tip">提示:请尽量多的输入内容，这样能更快的重置您的密码！</div>

    </form>
    {% elif type == 22 %}
        <div id="login" class="a col-sm-offset-4">密码重置...</div>
        <form class="form-horizontal" role="form" method="post" action="/auth/login/find/psw/?type=3&uid={{ uid }}">
        <div class="form-group" style="margin-right:0px">
            <label for="firstname" class="col-sm-4 control-label">请输入新密码</label>
            <div class="col-sm-5">
              <input type="password" name="psw" class="form-control" required id="firstname" placeholder="请输入新密码">
            </div>
        </div>
        <div class="form-group" style="margin-right:0px">
            <label for="firstname" class="col-sm-4 control-label">密码确认</label>
            <div class="col-sm-5">
              <input type="password" name="psw2" class="form-control" required id="firstname" placeholder="请再次输入密码">
            </div>
        </div>
        <div class="form-group" style="margin-right:0px">
            <div class="col-sm-offset-4 col-sm-6">
              <button type="submit" class="btn btn-default">提交</button>
            </div>
        </div>
        {% if error %}
        <div class="col-sm-offset-4 col-sm-8 error">{{ error }} </div>
        {% endif %}
        <div class="col-sm-offset-4 col-sm-8 tip">我突然想起了密码&#x3000;<a href="/">登录</a></div>
        <div class="col-sm-offset-4 col-sm-8 tip">提示:请妥善保管好您的新密码</div>

    </form>
    {% elif type == 33 %}
        <div id="suc" style="text-align: center;font-size: 2em;margin-top: 30px;font-family: '楷体'">
        {% if status %}
            <span>恭喜你！重置成功！</span><br>
            <span id="s">3</span>S后跳转至登录页...
            <a href="/" id="a">点此手动跳转</a>
        {% else %}
            <span>亲！发生错误啦！-_-</span><br>
            <span id="s">3</span>S后跳转至登录页...
            <a href="/" id="a">点此手动跳转</a>
        {% endif %}
        </div>
    {% endif %}
    <script src="{% static 'js/jquery.js' %}"></script>
<script>
        function dianji(){
                var num=3;
                name = setInterval(function() {
                 $("#s").html(num);// 你倒计时显示的地方元素
                    num--;
                   if(num<0){
{#                    clearInterval(name); // 清除倒计时#}
                       var a = document.getElementById('a');
                       a.click()
                        }
                    }, 1000);
                    }
        dianji()
</script>










{% endblock %}